home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1988 / 04 / xhello3.c < prev   
Text File  |  1988-05-09  |  1KB  |  48 lines

  1. #include <stdio.h>
  2. #include <X11/Xlib.h>
  3. #include <X11/Intrinsic.h>
  4. #include <X11/Atoms.h>
  5. #include <X11/Label.h>
  6.  
  7. #define    STRING    "Hello,  World"
  8.  
  9. Arg wargs[] = {
  10.     XtNlabel,    (XtArgVal) STRING,
  11. };
  12.  
  13. main(argc, argv)
  14.     int argc;
  15.     char **argv;
  16. {
  17.     Widget      toplevel, label;
  18.  
  19.     /*
  20.      * Create the Widget that represents the window.
  21.      * See Section 14 of the Toolkit manual.
  22.      */
  23.     toplevel = XtInitialize(argv[0], "XLabel", NULL, 0, &argc, argv);
  24.  
  25.     /*
  26.      * Create a Widget to display the string,  using wargs to set
  27.      * the string as its value.  See Section 9.1.
  28.      */
  29.     label = XtCreateWidget(argv[0], labelWidgetClass,
  30.                toplevel, wargs, XtNumber(wargs));
  31.  
  32.     /*
  33.      * Tell the toplevel widget to display the label.  See Section 13.5.2.
  34.      */
  35.     XtManageChild(label);
  36.  
  37.     /*
  38.      * Create the windows,  and set their attributes according
  39.      * to the Widget data.  See Section 9.2.
  40.      */
  41.     XtRealizeWidget(toplevel);
  42.  
  43.     /*
  44.      * Now process the events.  See Section 16.6.2.
  45.      */
  46.     XtMainLoop();
  47. }
  48.